package com.adcc.swingui.demo.menubar;

import java.awt.Container;
import java.util.List;

import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JMenu;
import javax.swing.JMenuItem;

import com.adcc.swingui.base.DefaultMenuBar;
import com.jidesoft.swing.JideMenu;

/**
 * 常规气象菜单
 * 
 * @author charlie
 * 
 */
public class ChangGuiQiXiangMenuBut extends DefaultMenuBar {

	JMenu menu;
	JMenuItem backItem;
	JMenuItem thunderItem;
	JMenuItem autoItem;

	public ChangGuiQiXiangMenuBut(Container container) {
		super(container);
	}

	@Override
	protected JComponent build() {
		menu = new JideMenu("常规气象资料");
		menu.setMnemonic('V');

		// 地面图
		backItem = new JMenuItem("地面图", new ImageIcon());
		addChildMenu(menu, backItem, "background", true);

		// 雷雨图
		thunderItem = new JMenuItem("雷雨图", new ImageIcon());
		addChildMenu(menu, thunderItem, "thunderstorm", true);

		// 自动站
		autoItem = new JMenuItem("自动站", new ImageIcon());
		addChildMenu(menu, autoItem, "autopiont", true);
		return menu;
	}

	/**
	 * 地面图
	 */
	public void background() {
		System.out.println("地面图");
	}

	/**
	 * 雷雨图
	 */
	public void thunderstorm() {
		System.out.println("雷雨图");
	}

	/**
	 * 自动站
	 */
	public void autopiont() {
		System.out.println("自动站");
	}

	@Override
	protected void offLineVisiable(List<JComponent> jcomps) {
		// TODO Auto-generated method stub

	}
}
